<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    x:Class="OpenLS.Spreadsheet.UI.SpreadsheetStatusBar"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ssui="clr-namespace:OpenLS.Spreadsheet.UI"
                    xmlns:oui="http://schemas.Kherty.com/office/2007"
                    xmlns:Internals="clr-namespace:OpenLS.Spreadsheet.UI.Internals"
    xmlns:Resources="clr-namespace:OpenLS.Spreadsheet.UI.Internals.Resources">
  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="/OpenLS.UI;component/Themes/OfficeResources.xaml"/>
    <ResourceDictionary Source="/OpenLS.UI;component/Themes/ZoomScrollBarResources.xaml"/>
  </ResourceDictionary.MergedDictionaries>
  <DataTemplate DataType ="{x:Type Internals:BackgroundOperation}">
    <ProgressBar Maximum ="100" VerticalAlignment ="Stretch" Value="{Binding Percentage}" Background="{x:Null}" BorderThickness="0"/>
   </DataTemplate>
  <DockPanel x:Key="{x:Static ssui:SpreadsheetWindowComponents.StatusBarKey}" x:Shared="true" 
             DataContext="{Binding RelativeSource={RelativeSource Self}, Path=(ssui:SpreadsheetElement.Workbook)}"
             TextElement.Foreground="{DynamicResource {x:Static oui:OfficeBrushes.TextForegroundKey}}"
    DockPanel.Dock ="Bottom" Margin="0 0 0 -1" Panel.ZIndex="1" Background="{DynamicResource {x:Static oui:OfficeBrushes.StatusBarBackgroundKey}}" LastChildFill="False">
    <DockPanel.Resources>
      <Style TargetType="{x:Type RepeatButton}" x:Key="TransparentButton">
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type RepeatButton}" >
              <Grid Background="{TemplateBinding Background}">

                <Ellipse Name="ellipse" StrokeThickness="1" Stroke="#FF2F578D" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                  <Ellipse.Fill>
                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
                      <GradientStop Offset="0" Color="#FFECF0F6" />
                      <GradientStop Offset="0.10389610389610388" Color="#FFF2F6FC" />
                      <GradientStop Offset="0.25974025974025994" Color="#FFC7DBF3" />
                      <GradientStop Offset="0.44155844155844132" Color="#FFBCCDE2" />
                      <GradientStop Offset="0.55844155844155863" Color="#FF84A2C6" />
                      <GradientStop Offset="0.7532467532467535" Color="#FFCCDFF2" />
                      <GradientStop Offset="0.92207792207792194" Color="#FFF4F8FC" />
                      <GradientStop Offset="1" Color="#FFF1F5F8" />
                    </LinearGradientBrush>
                  </Ellipse.Fill>
                </Ellipse>
                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" >
                  <ContentPresenter.BitmapEffect>
                    <OuterGlowBitmapEffect GlowSize="2" GlowColor ="White" Opacity="0.5"/>
                  </ContentPresenter.BitmapEffect>
                </ContentPresenter>
              </Grid>
              <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                  <Setter Property ="Fill" TargetName="ellipse">
                    <Setter.Value>
                      <LinearGradientBrush EndPoint="0,1" StartPoint="0,0" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
                        <GradientStop Offset="0" Color="#FFF3F5F7" />
                        <GradientStop Offset="0.20779220779220775" Color="#FFFFFEFC" />
                        <GradientStop Offset="0.28571428571428581" Color="#FFFFFDF5" />
                        <GradientStop Offset="0.45454545454545425" Color="#FFF2D990" />
                        <GradientStop Offset="0.51948051948051932" Color="#FFF2D990" />
                        <GradientStop Offset="0.72727272727272707" Color="#FFFEDF83" />
                        <GradientStop Offset="0.90909090909090906" Color="#FFFFE59B" />
                        <GradientStop Offset="1" Color="#FFF2E9CB" />
                      </LinearGradientBrush>
                    </Setter.Value>
                  </Setter>
                </Trigger>
              </ControlTemplate.Triggers>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
        <Setter Property="Width" Value="16"/>
        <Setter Property="Height" Value="16"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="Background" Value="{DynamicResource {x:Static oui:OfficeBrushes.ZoomBackgroundKey}}"/>
      </Style>
    </DockPanel.Resources>
    <DockPanel Background="{DynamicResource {x:Static oui:OfficeBrushes.ZoomBackgroundKey}}"  DockPanel.Dock="Right" FocusManager.IsFocusScope="True">
      <ResizeGrip DockPanel.Dock="Right" Foreground="{DynamicResource {x:Static oui:OfficeBrushes.TextForegroundKey}}">
        <ResizeGrip.Template>
          <ControlTemplate TargetType="{x:Type ResizeGrip}">
            <Grid Background="{TemplateBinding Background}" x:Name="Grid" SnapsToDevicePixels="True">
              <Path Fill="#FFB1C9E8" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,2,2" x:Name="Path" Data="M8,0L10,0 10,2 8,2z M4,4L6,4 6,6 4,6z M8,4L10,4 10,6 8,6z M0,8L2,8 2,10 0,10z M4,8L6,8 6,10 4,10z M8,8L10,8 10,10 8,10z"/>
              <Path Fill="#FF455D80" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,3,3" x:Name="Path1" Data="M8,0L10,0 10,2 8,2z M4,4L6,4 6,6 4,6z M8,4L10,4 10,6 8,6z M0,8L2,8 2,10 0,10z M4,8L6,8 6,10 4,10z M8,8L10,8 10,10 8,10z"/>
            </Grid>
          </ControlTemplate>

        </ResizeGrip.Template>
      </ResizeGrip>
      <ScrollBar Minimum="10" Maximum="400" Value="{Binding Path=View.ActiveSheet.View.ZoomScale, FallbackValue=100}" MinWidth="120" Style="{DynamicResource {x:Static oui:Styles.ZoomScrollBarStyleKey}}"
              DockPanel.Dock="Right" Focusable ="False" HorizontalAlignment="Right" Orientation="Horizontal" SmallChange="10" LargeChange ="10"
                />
      <Button Foreground="{DynamicResource {x:Static oui:OfficeBrushes.TextForegroundKey}}" VerticalAlignment="Stretch" DockPanel.Dock="Right" HorizontalAlignment="Right"
              Command="{x:Static oui:ViewCommands.SetZoom}" TextElement.Foreground="{DynamicResource {x:Static oui:OfficeBrushes.TextForegroundKey}}">

        <Button.Style>
          <Style TargetType ="{x:Type Button}" >
            <Setter Property ="Margin" Value="0"/>
            <Setter Property ="Background" Value ="{DynamicResource {x:Static oui:OfficeBrushes.ZoomBackgroundKey}}"/>
            <Setter Property ="Template">
              <Setter.Value>
                <ControlTemplate TargetType ="{x:Type Button}">
                  <Grid Background ="{TemplateBinding Background}">
                    <Border CornerRadius="1" BorderBrush="#FF9EBBE1" BorderThickness="1">
                      <ContentPresenter HorizontalAlignment ="Center" VerticalAlignment ="Center"/>
                    </Border>
                  </Grid>
                </ControlTemplate>
              </Setter.Value>
            </Setter>
            <Style.Triggers>
              <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value ="{DynamicResource {x:Static oui:OfficeBrushes.ButtonHoverBackgroundKey}}"/>
              </Trigger>
              <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value ="{DynamicResource {x:Static oui:OfficeBrushes.ButtonHoverSelectedBackgroundKey}}"/>
              </Trigger>
            </Style.Triggers>
          </Style>
        </Button.Style>
        <StackPanel Orientation="Horizontal" ToolTip="Zoom level. Click to open the zoom dialog box"> <!-- loc-->
          <TextBlock Text="{Binding Path=View.ActiveSheet.View.ZoomScale}"  Foreground="{DynamicResource {x:Static oui:OfficeBrushes.TextForegroundKey}}" MinWidth="0" Margin="0"/>
          <TextBlock  Foreground="{DynamicResource {x:Static oui:OfficeBrushes.TextForegroundKey}}">%</TextBlock>
        </StackPanel>
      </Button>
    </DockPanel>
    <ContentControl VerticalAlignment ="Stretch" Width ="100" Content="{Binding Path=(ssui:SpreadsheetElement.Operation), RelativeSource={RelativeSource Self}}"/>
        <TextBlock Text="{x:Static Resources:UIStringTable.ToggleEndMode}">
            <TextBlock.Style>
                <Style TargetType="{x:Type TextBlock}">
                    <Style.Triggers>
                        <Trigger Property="Internals:EditionElement.IsInEndMode" Value="False" >
                            <Setter Property="Visibility" Value="Collapsed" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </TextBlock.Style>
        </TextBlock>
  </DockPanel>


</ResourceDictionary>